﻿<Window x:Class="Lithnet.Acma.Presentation.NewReferenceLinkWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation"
        xmlns:a="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
        xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
        xmlns:fim="clr-namespace:Microsoft.MetadirectoryServices;assembly=Microsoft.MetadirectoryServicesEx"
        Title="{Binding DisplayName}"
        Height="300"
        Width="398"
        ResizeMode="CanResize"
        ShowInTaskbar="False"
        Topmost="True"
        WindowStartupLocation="CenterScreen"
        Icon="{Binding DisplayIcon}">

        <Grid HorizontalAlignment="Left"
          Width="367">

        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition  />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.Margin>
                    <Thickness>15</Thickness>
                </Grid.Margin>

                <Label Content="Object class"
                       Grid.Row="0"
                       Grid.Column="0" />
                <TextBox Grid.Row="0"
                         Grid.Column="1"
                         Margin="2"
                         Text="{Binding ForwardLinkObjectClass.Name, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=true, Mode=OneTime}"
                         IsReadOnly="True"/>

                <Label Content="Source attribute"
                       Grid.Row="1"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding AllowedForwardLinkAttributes}"
                          SelectedItem="{Binding ForwardLinkAttribute, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Margin="2"
                          Grid.Row="1"
                          Grid.Column="1" />

                <Label Content="Back-link target class"
                       Grid.Row="2"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding AllowedBackLinkObjectClasses}"
                          SelectedItem="{Binding BackLinkObjectClass, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Margin="2"
                          Grid.Row="2"
                          Grid.Column="1" />

                <Label Content="Attribute to back-link to"
                       Grid.Row="3"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding AllowedBackLinkAttributes}"
                          SelectedItem="{Binding BackLinkAttribute, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Margin="2"
                          Grid.Row="3"
                          Grid.Column="1" 
                          />
            </Grid>
        </StackPanel>

        <StackPanel Grid.Row="1"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Bottom">
            <Button Content="OK"
                    MinWidth="50"
                    MinHeight="27"
                    Margin="5"
                    Command="{Binding Commands.Create}"
                    IsDefault="True" />
            <Button Content="Cancel"
                    Margin="5"
                    MinWidth="50"
                    MinHeight="27"
                    IsCancel="True" />
        </StackPanel>
    </Grid>
</Window>
